package com.slwu.factory.method;

import java.io.File;

/**
 * 抽象图片读取器
 * @author wushaolin
 * @since 2023-11-27
 */
public abstract class ImageReader {

    private String format;
    private int width;
    private int height;


    public String getFormat() {
        return format;
    }
    public void setFormat(String format) {
        this.format = format;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public void read(String fileName) {
        read(new File(fileName));
    }
    public void read(String fileName, String format) {
        read(new File(fileName), format);
    }
    public void read(String fileName, String format, int width, int height) {
        read(new File(fileName), format, width, height);
    }

    public void read(File file) {
        read(file, "UTF-8");
    }
    public void read(File file, String format) {
        read(file, "UTF-8", 100, 100);
    }
    public abstract void read(File file, String format, int width, int height);
}
